<template>
  <div class="Progress">
    <div class="front" :style="{ background: backgroundYuan }">{{ value }}</div>
    <div class="bg">
      <div class="bgAfter" :style="{ transform: `rotate(${-180 + degNum}deg)`, background: color }"></div>
    </div>
    <div class="textView">
      <div class="dot" :style="{ background: color }"></div>
      <div class="text">{{ text }}</div>
    </div>
  </div>
</template>
<script>
export default {
  props: {
    color: {
      type: String,
      default: '#fff'
    },
    text: {
      type: String,
      default: '默认',
      require: true
    },
    backgroundYuan: {
      type: String,
      default: '#010429',
      require: true
    },
    value: {
      type: [String, Number],
      default: '默认',
      require: true
    },
    degNum: { type: Number, default: 0, require: true }
  }
}
</script>
<style scoped lang="scss">
.Progress {
  width: 120px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  margin: 10px;
}

.bg {
  width: 120px;
  height: 60px;
  border-radius: 75px 75px 0 0;
  background: #010429;
  box-sizing: border-box;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: #fff;
  .bgAfter {
    position: absolute;
    left: 0;
    top: 0;
    width: 120px;
    height: 60px;
    border-radius: 75px 75px 0 0;
    background: #010429;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;

    transform-origin: center 100%;
  }
}
.front {
  position: absolute;
  top: 15px;
  width: 90px;
  height: 60px;
  color: #fff;
  line-height: 70px;
  font-size: 24px;
  z-index: 10;
  border-radius: 75px 75px 0 0;
  display: flex;
  justify-content: center;
}
.textView {
  display: flex;
  align-items: center;
  margin-top: 20px;
  .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
  }
  .text {
    margin-left: 10px;
    font-size: 16px;
    color: #fff;
  }
}
</style>
